package com.woniuxy.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016101100662340";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDMEsLEp/mr3EYpCy0J265JjXf1d9l5kMuA66nYcAD1Ihme4s1udDSc6+4OCGCBu3TSIvlDX6I6aecRzRVM0GyDjNqFRf/P+ewkpV/Zzw35aV/E8nzsIRU1to7831c70hV9q8TIWp2wXdg94MZccYkOosWMPDm4DrV7P/Oh/UKEr2LD2PHR/C7+jJBaN4KwrQjVSX/pGH6okS0xeJx13sPbcYv1mpoGAQoRROQgfAwM+RcTkhDkjAVxK1X9d7AKo1dhzZeKGCiZ9No1cwaCrr6OhI4FsUcUJkt/kwiJexPDXKVG+tBusf822ijD4lPU1xEXg9P2W1FXHEdDGnqYIA19AgMBAAECggEBAKMV4xzx+G9Fy7QFQGr+apxROCqtKtkhw+A1dTiI2dsM81ise+vnZhx513bTbvx+aG9+j6EuDiGMfKMXOAx5DB9dM00KkdMNMZBfsOgJtms5sNVdzEOQdLjGOiMQAVDHJXGXEd3jvN0zQhrBRQSfnx5ZKnJVtvLGnnXut68fDEeny1JTpvoqJ64A1V1m6lNcI3icmimfHj/o9fD2kCib3h2wbb4tfZWjthrboHFlGgQNlYNgGBC/squSem0c3GCW7VlORlEfiDvdjGueqlyGZMnixthqcx8TWxP5PUHsAv61ovPh+PJzAnwXMtck6D8D7H/ekbgJ0YgnCL26rrC+ZykCgYEA95R/hp9A3waW7dIKaDDXqpFw3OV7YbB66+J3x4heBn3S88skLYwssYejwj3oltzSryoKCuhCEVnw25Xhi2eRGwtxe3bCZHO0/ukl4wykFZDTbjHpan/7y+jKXig1bhArffJXtzekOPcGS5HxFx6qOX/e2JkbrK+hhmV+mRUrUtMCgYEA0wN69os/FOv2SH7KPeL1T8YH4S/4YY0nIQJ0uAjOg0Ug3Dtq6zHS9Xxp7n0L3CRBOSFQcM/R2a4S59Ff1z6MtS9nqCMQqfZ+2cvwby3QY8HRJXtNkW8m/3XWdAfHHTJD3cKNWlv1NAHSKxPagGPhnBF5vs9JPEIU6f+pNo3tzG8CgYEAo8OQTyYMLPoY35qt05lrLqIhu5v37vhjdqBIhq2HNFgKL8TRW2d7MLr98UAuF4xduAvgtLJI8V1C2pzbofCRpQf+uqIll3iJ4oupyfPUnYc8s4lEUnPxxEFpirqiDPmZKyggKUsez6dmfJo+lQJtqrcQWsl76tAJ0fJUuUGtdI0CgYB2xuy+Pp9hjXjyUbxRnaFsKBJjZXcwoh22bQV6Wiq0pYLbtO54OXGAEWonfmfgoN+94sy+05xSJbQqnSaPqHvXuTll4WcN5Nx+iFdsnaNBo+WwbXm6NZEEFzaB1ab0/khJWavrgvvBLI07Bk/mGVLzYLrg9xlIPAI9vVVoifejLQKBgB+I5cVJXEFQI04zXNuLY+6ZEuI/7/OcSRTKI4Ihyub6Q88t911rHfCpbsW9odDDxdXOBzNHkkUaRU1qg+XS0RpcytnmDKWvJy971r8MwXH7Qc9VQtI+BHyU9WmIJ63tDxlXIZWGJz6K4T31VAqRu0McRV1AFWHOTnZx5TZ2gkQk";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0dGo95X2/p3A8HivgfXcoWHpCBdPxgn8bDb9FYcGx1A57L2blagzHGJjhq/wGHu1zqq1bx5LLW4m7VIkFtmW7SPWxbggUX2p9yQETIHGRSjLS2LmRM18amsgLedEf6PPE2BSXY7bQgx3aGkVWiVQ4Q/vzXdlyFIMnIQVOyT+LXWhB5lIvcOYOb631fwfNPuragiUpTNnoaJK21uhTi2opOjHMWjENnXYJdgqXwSovjcGPO8Sk7jkFIpocbO+t1T84YwSZeGIPhU0Abzw5Wq7yYplsMTZDTY2O+SGfPwsiQLZc1mZUjFnEQRV4bay29uedQnIcHboY3OVANkrABtC7QIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://25b521r000.zicp.vip/alipay/notify";

    //http://localhost:8130/pay
    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://25b521r000.zicp.vip/alipay/syn";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

